package com.cooksys.film_rental.dao;

import java.util.List;

import com.cooksys.film_rental.model.Customer;
import com.cooksys.film_rental.model.Inventory;
import com.cooksys.film_rental.model.Payment;
import com.cooksys.film_rental.model.Rental;
import com.cooksys.film_rental.model.Staff;

/**
 * Data access object for the {@link Rental} class
 * 
 * @author Peter Zastoupil
 * 
 */
public interface RentalDao {

	/**
	 * 
	 * @param rentalId
	 *            the rentalId to search by
	 * @return the {@link Rental} object associated with the given rentalId
	 */
	public Rental getRentalByRentalId(Integer rentalId);

	/**
	 * 
	 * @param staff
	 *            the {@link Staff} to search by
	 * @return a List of {@link Rental} objects associated with the given staff
	 */
	public List<Rental> searchRentalsByStaff(Staff staff);

	/**
	 * 
	 * @param customer
	 *            the {@link Customer} to search by
	 * @return a List of {@link Rental} objects associated with the given
	 *         customer
	 */
	public List<Rental> searchRentalsByCustomer(Customer customer);

	/**
	 * 
	 * @param inventory
	 *            the {@link Inventory} to search by
	 * @return a List of {@link Rental} objects associated with the given
	 *         inventory
	 */
	public List<Rental> searchRentalsByInventory(Inventory inventory);

	/**
	 * 
	 * @param payment
	 *            the {@link Payment} to search by
	 * @return the {@link Rental} object associated with the given payment
	 */
	public Rental getRentalByPayment(Payment payment);

	/**
	 * 
	 * @param rental
	 *            the {@link Rental} object to save in the database
	 * @return the {@link Rental} object that was saved in the database
	 */
	public Rental save(Rental rental);

	/**
	 * 
	 * @param rental
	 *            the {@link Rental} object to remove from the database
	 */
	public void delete(Rental rental);

	/**
	 * 
	 * @param rental
	 *            the {@link Rental} object to update in the database
	 */
	public void update(Rental rental);

}
